load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
load("//tools/build_defs/oss:rn_defs.bzl", "rn_android_library", "rn_android_prebuilt_aar", "rn_prebuilt_jar")

rn_android_prebuilt_aar(
    name = "fresco-react-native",
    aar = ":fresco-binary-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "fresco-binary-aar",
    sha1 = "fbc98413bb32eefe882a07cc556c7a1224dc9f24",
    url = "mvn:com.facebook.fresco:fresco:aar:2.3.0",
)

rn_android_prebuilt_aar(
    name = "fresco-drawee",
    aar = ":drawee-binary-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "drawee-binary-aar",
    sha1 = "1cff917b6f19efe7a21ca542c8b8bed18d0d9779",
    url = "mvn:com.facebook.fresco:drawee:aar:2.3.0",
)

rn_android_library(
    name = "imagepipeline",
    autoglob = False,
    visibility = ["//ReactAndroid/..."],
    exported_deps = [
        ":bolts",
        ":imagepipeline-base",
        ":imagepipeline-core",
        ":imagepipeline-native",
        ":memory-type-ashmem",
        ":memory-type-java",
        ":memory-type-native",
        ":native-filters",
        ":native-transcoder",
        ":ui-common",
    ],
)

rn_android_prebuilt_aar(
    name = "imagepipeline-base",
    aar = ":imagepipeline-base-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "imagepipeline-base-aar",
    sha1 = "ed3c290961f4c20fffa0ce35c098714c1934523d",
    url = "mvn:com.facebook.fresco:imagepipeline-base:aar:2.3.0",
)

rn_android_prebuilt_aar(
    name = "imagepipeline-core",
    aar = ":imagepipeline-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "imagepipeline-aar",
    sha1 = "579954628c8e1da96e1585741f5dae08f282ce3e",
    url = "mvn:com.facebook.fresco:imagepipeline:aar:2.3.0",
)

rn_android_prebuilt_aar(
    name = "native-filters",
    aar = ":nativeimagefilters-aar",
    visibility = ["//ReactAndroid/..."],
)

remote_file(
    name = "nativeimagefilters-aar",
    sha1 = "1f4d81f8f6e2706ae848124d454c99cadd85496c",
    url = "mvn:com.facebook.fresco:nativeimagefilters:aar:2.3.0",
)

rn_android_prebuilt_aar(
    name = "native-transcoder",
    aar = ":nativeimagetranscoder-aar",
    visibility = ["//ReactAndroid/..."],
)

remote_file(
    name = "nativeimagetranscoder-aar",
    sha1 = "1b74432d16db744719dfe1d03d4d93850e061d08",
    url = "mvn:com.facebook.fresco:nativeimagetranscoder:aar:2.3.0",
)

rn_prebuilt_jar(
    name = "bolts",
    binary_jar = ":download-bolts.jar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "download-bolts.jar",
    sha1 = "d85884acf6810a3bbbecb587f239005cbc846dc4",
    url = "mvn:com.parse.bolts:bolts-tasks:jar:1.4.0",
)

rn_android_prebuilt_aar(
    name = "fbcore",
    aar = ":fbcore-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "fbcore-aar",
    sha1 = "6d568ce3e1a5377c390dbde6f150884fecd61bd0",
    url = "mvn:com.facebook.fresco:fbcore:aar:2.3.0",
)

rn_android_prebuilt_aar(
    name = "imagepipeline-native",
    aar = ":imagepipeline-native-binary-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "imagepipeline-native-binary-aar",
    sha1 = "705a3629cfba16ab8c9b2765058380276514342c",
    url = "mvn:com.facebook.fresco:imagepipeline-native:aar:2.3.0",
)

rn_android_prebuilt_aar(
    name = "imagepipeline-okhttp3",
    aar = ":imagepipeline-okhttp3-binary-aar",
    visibility = ["//ReactAndroid/..."],
)

fb_native.remote_file(
    name = "imagepipeline-okhttp3-binary-aar",
    sha1 = "1065513f02b97ee46601d92105151ae9e2111bfc",
    url = "mvn:com.facebook.fresco:imagepipeline-okhttp3:aar:2.3.0",
)

rn_android_prebuilt_aar(
    name = "memory-type-ashmem",
    aar = ":memory-type-ashmem-aar",
    visibility = ["//ReactAndroid/..."],
)

remote_file(
    name = "memory-type-ashmem-aar",
    sha1 = "d0e2ab70d5d35d08de81d3917b0f5d7bbf4fa82c",
    url = "mvn:com.facebook.fresco:memory-type-ashmem:aar:2.3.0",
)

rn_android_prebuilt_aar(
    name = "memory-type-java",
    aar = ":memory-type-java-aar",
    visibility = ["//ReactAndroid/..."],
)

remote_file(
    name = "memory-type-java-aar",
    sha1 = "5e8adc594bc9d8f4e8d794dff23c70882fb98e65",
    url = "mvn:com.facebook.fresco:memory-type-java:aar:2.3.0",
)

rn_android_prebuilt_aar(
    name = "memory-type-native",
    aar = ":memory-type-native-aar",
    visibility = ["//ReactAndroid/..."],
)

remote_file(
    name = "memory-type-native-aar",
    sha1 = "72bb5626d508587cb9d96beb0e2b61ac36a2c63d",
    url = "mvn:com.facebook.fresco:memory-type-native:aar:2.3.0",
)

rn_android_prebuilt_aar(
    name = "ui-common",
    aar = ":ui-common-aar",
    visibility = ["//ReactAndroid/..."],
)

remote_file(
    name = "ui-common-aar",
    sha1 = "0ce37a495f0f37165e3ede1c4cb927b0b55856be",
    url = "mvn:com.facebook.fresco:ui-common:aar:2.3.0",
)
